# Removes one local Windows policy value using the same variables as Apply-CustomerPolicy.ps1.
# Required variables: FW_POLICY_KEY and FW_POLICY_VALUE. Optional: FW_POLICY_SCOPE.

$ErrorActionPreference = "Stop"

$ApplyScript = Join-Path $PSScriptRoot "Apply-CustomerPolicy.ps1"

if (-not (Test-Path $ApplyScript -PathType Leaf)) {
    throw "Apply-CustomerPolicy.ps1 was not found beside this script."
}

[Environment]::SetEnvironmentVariable("FW_POLICY_ACTION", "DELETE", "Process")

& $ApplyScript

exit $LASTEXITCODE
